﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO.IsolatedStorage;
using System.IO;
using Caliburn.Micro;

namespace CetWin.ViewModels
{
    public class LogViewModel:Screen
    {
        public LogViewModel()
        {
            IsolatedStorageFile isFile = IsolatedStorageFile.GetUserStoreForApplication();
            if (isFile.FileExists(logTxt))
            {
                var stream = isFile.OpenFile(logTxt, System.IO.FileMode.Open);
                var sr = new StreamReader(stream);
                this.DisplayName = sr.ReadToEnd();
            }
            else
            {
                isFile.CreateFile(logTxt);
            }
        }

        private string logTxt = "log.txt";
    }
}
